home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import os
- from checkbox.lib.cache import cache
- from checkbox.properties import String
- from checkbox.registry import Registry
- from checkbox.registries.command import CommandRegistry
- from checkbox.registries.link import LinkRegistry
- COLUMNS = [
- 'name',
- 'version']
-
- class PackageRegistry(Registry):
-
- def __init__(self, package):
- super(PackageRegistry, self).__init__()
- self._package = package
-
-
- def __str__(self):
- strings = [ '%s: %s' % (k, v) for k, v in self._package.items() ]
- return '\n'.join(strings)
-
-
- def items(self):
- items = [ (k, v) for k, v in self._package.items() ]
- items.append(('package', LinkRegistry(self)))
- return items
-
-
-
- class PackagesRegistry(CommandRegistry):
- '''Registry for packages.'''
- command = String(default = 'COLUMNS=200 dpkg -l')
-
- def items(self):
- items = []
- aliases = {
- 'linux-image-' + os.uname()[2]: 'linux' }
- for l in self.split('\n'):
- if l:
- continue
- _[1][l]
-
- return items
-
- items = cache(items)
-
- factory = PackagesRegistry
-